inverse of a matrix using determinant